If you are using the translator, you're limited by the way it performs its translation. You would be better off providing your own replacement for the translator, because you understand your data structures better.
You can use the following code snippet as a starting point to create your own translator. It creates a GX Ink with a simple 8 x 8 black and white bit pattern, allows an arbitrary color for foreground and another for background, and can be added to a frame or fill:
//Code for calling SetShapeQDPattern() { char pattern[] = {0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55}; RGBColor fore, back; fore.red = 0xFFFF; fore.green = 0; fore.blue = 0; back.red = 0; back.green = 0xFFFF; back.blue = 0; SetShapeQDPattern(tempShape, (PatPtr)&pattern, &fore, &back); } //SetShapeQDPattern() // ------------------------------------------------------------------------------------- static void SetShapeQDPattern( gxShape theShape, // shape to set pattern on PatPtr pPattern, // 1 bit QD pattern to use RGBColor *pForeColor, // color of the 0 bits (or is this 1?) RGBColor *pBackColor) // color of the 1 bits (or is this 0?) { gxPatternRecord pattern; gxBitmap bits; gxSetColor colors[2]; pattern.attributes = 0; pattern.u.x = ff(8); pattern.u.y = ff(0); pattern.v.x = ff(0); pattern.v.y = ff(8); colors[0].rgb.red = pForeColor->red; colors[0].rgb.green = pForeColor->green; colors[0].rgb.blue = pForeColor->blue; colors[1].rgb.red = pBackColor->red; colors[1].rgb.green = pBackColor->green; colors[1].rgb.blue = pBackColor->blue; bits.image = (char*)pPattern; bits.width = 8; bits.height = 8; bits.rowBytes = 1; bits.pixelSize = 1; bits.space = gxIndexedSpace; bits.set = GXNewColorSet(gxRGBSpace, 2, &colors); bits.profile = nil; pattern.pattern = GXNewBitmap(&bits, nil); GXDisposeColorSet(bits.set); GXSetShapePattern(theShape, &pattern); GXDisposeShape(pattern.pattern); } // SetShapeQDPattern //--------------------------------------------------
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help